<?php

// -----------------------------------------------------------------------------
// include
// -----------------------------------------------------------------------------

include "../config/config.php";
include "../auth.php";
include "../DBManager.php";

// -----------------------------------------------------------------------------
// 数据库相关设置
// -----------------------------------------------------------------------------

$dbPath = "../" . $dbPath; // 不加这行语句的话会报错，提示找不到对应路径
$db = new DBManager("sqlite:" . $dbPath);

// -----------------------------------------------------------------------------

$years = $db->getListOfYearsOfSummariesAndPlans();

if (is_array($years)) {
    if (count($years) > 0) {

        echo <<<BBB
            <div class="list-group mt-3">
        BBB;

        foreach ($years as $year) {
            echo <<<BBB
                <a href="listOfSummariesAndPlans.php?year={$year}&sort=sortNumber&sequence=desc" class="list-group-item list-group-item-action">{$year}</a>
            BBB;
        }

        echo <<<BBB
            </div>
        BBB;

    }
}

// -----------------------------------------------------------------------------
